<div class="modal fade modal-md" id="modelContent">
	<div class="modal-dialog modal-md">
        <div class="modal-content"></div>
    </div>
</div>
<div class="portlet box green">
	<div class="portlet-title">
	    <div class="caption"><i class="fa fa-cog"></i>账房 > 单据管理 > 收款单 </div>
		<div class="tools">
			<a href="javascript:;" class="collapse right" data-original-title="" title=""> </a>
    	</div>
    	<div class="actions">
			<a href="javascript:;" class="btn white btn-sm ajax-search"><i class="fa fa-search"></i> 查询 </a>
			<a href="javascript:;" class="btn white btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
		</div>
	</div>
	<div class="portlet-body form">
	   	<form action="/orderReceipt/list" class="form-horizontal" method="get" id="searchForm" onsubmit="return false">
			<div class="form-body">
				<div class="row">
					<div class="form-group">
						注：1.系统"收款总额"存在两种抵扣方式：现金支付、信用支付；</br>
						收款单记录收款总额，订单收款现金、信用支付在收款单详情中可查看。
					</div>
					<div class="form-group">
						<div class="col-md-3">
							<label class="col-md-4 control-label">收款单号：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="id" value="$!id">
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">支付会员号：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="userInfoId" value="$!userInfoId">
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">支付类型：</label>
							<div class="col-md-6">
						    	<select name="settleWay" class="form-control">
									<option value=""></option>
									<option value="CREDIT" #if($settleWay=='CREDIT') selected="selected" #end>信用支付</option>
									<option value="WECHAT" #if($settleWay=='WECHAT') selected="selected" #end>微信支付</option>
									<option value="ALIPAY" #if($settleWay=='ALIPAY') selected="selected" #end>支付宝支付</option>
									<option value="ONLINE_BANK" #if($settleWay=='ONLINE_BANK') selected="selected" #end>企业网银</option>
									<option value="PAY_OFFLINE" #if($settleWay=='PAY_OFFLINE') selected="selected" #end>线下支付</option>
								</select>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-3">
							<label class="control-label col-md-4">支付时间：</label> 
							<label class="col-md-8">
								<input class="form-control" type="text" name="startTime" id="startTime" value="$!startTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</label>
						</div>
						<div class="col-md-3">
							<label class="control-label col-md-2">至：</label> 
							<label class="col-md-8">
								<input class="form-control" type="text" name="endTime" id="endTime" value="$!endTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</label>
						</div>
					</div>
	    		</div>
			</div>
		</form>
	</div>
</div>

<div class="portlet box green">
    <div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions">
			<a href="#modelContent" thref="/orderReceipt/add" class="btn white btn-sm ajax-model-get" data-toggle="modal"><i class="fa fa-plus"></i> 新增  </a>
			<a  id="export" class="btn white btn-sm"  ><i class="fa fa-cloud-download"></i> 导出 </a>
		</div>
    </div>
    <div class="portlet-body">
		<div class="tabbable-line ">
			<div class="tab-content">
				<div class="tab-pane active form">
					<div class="table-container table-scrollable">
						<table class="table table-bordered table-hover icheck-table" id="productTable">
							<thead>
									<tr>
											<th>
                                             <input type="checkbox" class="icheck group-icheck" />
											</th>
											<th>收款单号</th>
						  		 		<!-- 	<th>订单号</th> -->
						  		 			<th>收款金额(￥)</th>
						  		 			<th>支付类型</th>
						  		 			<th>付款会员</th>
						  		 			<th>所属企业</th>
						  		 			<th>付款时间</th>
										<th class="col-md-2">操作</th>
									</tr>
								</thead>
								<tbody>
								#foreach($item in $pageOrderReceipt.result)
								#set($userInfo=$userInfoMap.get($item))
								#set($company=$companyMap.get($item))
								
						 				<tr>  
						 				<td><input type="checkbox" name="checkboxes" class="icheck " value="$!item.id" /></td>
									    <td>$!item.id</td> 
									    <!-- <td>#if($item.orderId) $!item.orderId #else - #end</td> -->
									    <td>$!item.cashFee</td>
									    <td>#if($!item.settleWay.name!='') $!item.settleWay.name #else -  #end</td>
									 <!--    <td>#if($userInfo.id) $!userInfo.id #else - #end</td> -->
									 
									 <td>
									  #if($!userInfo.nickname.length() > 0) 
									    $!userInfo.nickname 
									  #else
									    $!userInfo.realname
									  #end 
									  </td>
									    <td>$!company.name</td>
									    <td>$!item.timeString</td>
						    			<td>
											<a class="btn green btn-outline btn-sm ajaxify" href="/orderReceipt/detail?id=$!item.id">
												<i class="fa fa-eye"></i>	详情
											</a>
									    </td>		  			
						 				</tr>
								#end
								</tbody>
							</table>
					</div>
					#set($page= $pageOrderReceipt)
					#set($pageUrl="/orderReceipt/list?$!queryString&pageNo=")
					#parse("_page.htm")
				</div>
				<div> 
				金额总计：$!sum
				</div>
				
			</div>
			<form id="excel_download" action="/orderReceipt/exportExcel"
				class="hide" method="POST">
				<input type="hidden" name="rId" id="rId">
				<button type="submit"></button>
			</form>
		</div>
    </div>
</div>
<script type="text/javascript">
     $("input[name=id]").focus();
</script>
<script type="text/javascript">
/**
 * 导出报价单
 */
$("#export").click(function(){
	var array = new Array()
	var target= $("input[name='checkboxes']");
	//循环加入数组
	
		$.each(target,function(i,v){
			if(v.checked){
				array.push($(v).val());
			}
		});
	if(array.length>0){
		$("#rId").val(array);
		$("#excel_download").submit();
	}else{
		toastr.warning("请勾选要导出的收款单！");
	}
})
</script>
<script src="/assets/scripts/views-date.js" type="text/javascript"></script>
<script type="text/javascript" src="/assets/scripts/views-icheck.js"></script>
